home *** CD-ROM | disk | FTP | other *** search
- ;Light the skin with a directional lights and a bump map.
- ;
- ;B = Base map
- ;N = Per pixel normal from normal map
- ;D1 = Light 1 Direction in t2
- ;C1 = Light 1 Color in c2
- ;AL = Ambient lighting in oD0
- ;MC = Material color in oD1
- ;Oc = Output color
- ;Oa = Output alpha
- ;
- ;Oc = B * MC * (((N dot D1) * C1) + ((N dot D2) * C2))
- ;Oa = 1
-
- ps.1.1
-
- def c0, 1.0, 1.0, 1.0, 1.0
-
- tex t0 ;Sample base map
- tex t1 ;Sample normal map
- tex t2 ;Sample gloss map
-
-
- dp3_sat r1, t1_bx2, v1_bx2 ;half vector dot normal
-
- ; exp specular
- mul r1, r1, r1
- mul r1, r1, r1
-
- ; modulate gloss
- mul_sat r1, t2, r1
-
-
- ; N dot L. Both vectors are biased coming out of the vertex shader.
- dp3_sat r0, t1_bx2, v0_bx2 ;N dot L for Light1 - normal shading
- mad_sat r0, r0, c2, c1 ;Color for Light1 C3 = dircolor + C2 = ambcolor
-
-
- ; add specular component
-
- mad_sat r0.rgb, r0, t0, r1
- +mov r0.a, c3
-